/* week05 实验1
输入一个学生的成绩(百分制)，输出该学生的成绩和对应的等级
A:90~100
B:80~89
C:70~79
D:60~69
F:0~59
1.输入  85
2.输出 x=85 is grade B!
*/
#include <stdio.h>
int main(){
    int grade;
    printf("Please enter a score(1~100):");
    scanf("%d",&grade);
    //分段的判别
    if(grade > 100 || grade <0){
        printf("Valid value!\n");
    }
    else{
        if(grade >= 90)
            printf("x=%d is grade A!\n",grade);
            else if (grade >= 80)
            {
                printf("x=%d is grade B!\n",grade);
            }
            else if (grade >= 70)
            {
               printf("x=%d is grade C!\n",grade);
            }
            else if (grade >= 60)
            {
                printf("x=%d is grade D!\n",grade);
            }
            else
            {
                printf("Fail in the exam!\n");
            }                        
    } 
    return 0;
}